package com.weixing.mall.provider.controller.common;

import com.weixing.mall.base.wrapper.Result;
import com.weixing.mall.base.wrapper.ResultUtil;
import com.weixing.mall.core.annotation.NoNeedAccess;
import com.weixing.mall.core.support.BaseController;
import com.weixing.mall.provider.model.vo.cms.CityAreaCascaderVo;
import com.weixing.mall.provider.service.ICityAreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 行政区划APi
 *
 * @author siashan
 * @date  2019/7/26
 * @since  1.0
 **/
@RestController
@RequestMapping("cityArea/comm")
public class CityAreaCommController extends BaseController {

    @Autowired
    private ICityAreaService cityAreaService;

    /**
     * 行政区划级联
     *
     * @return 级联
     */
    @GetMapping("form")
    @NoNeedAccess
    public Result<List<CityAreaCascaderVo>> form(){
        List<CityAreaCascaderVo> list = cityAreaService.selectCityAreaCasaderVo();
        return ResultUtil.success(list);
    }
}
